﻿using System;
using System.ComponentModel.DataAnnotations;
using iss.sg4210.se18.team6s.jass.DAL.DataAccess.Utility;
using System.ComponentModel;

namespace iss.sg4210.se18.team6s.jass.DAL
{
    [MetadataType(typeof(AlertCriteriaMetaData))]
    public partial class AlertCriteria
    {
    }

    [IntegerCompare("ExperienceFrom", "ExperienceTo", ErrorMessage = "Experience From cannot be greater than Experience To!")]
    [IntegerCompare("SalaryFrom", "SalaryTo", ErrorMessage = "Salary From cannot be greater than Salary To!")]
    public class AlertCriteriaMetaData
    {
        #region Primitive Properties

        [Required]
        [Email(ErrorMessage = "Invalid Email Address")]
        [DataType(DataType.EmailAddress)]
        [DisplayName("Email")]
        public object email
        {
            set;
            get;
        }

        [Required]
        public object Keywords
        {
            set;
            get;
        }

        [DisplayName("Experience From")]
        //[Integer(ErrorMessage = "Integer value is required!")]
        public object ExperienceFrom
        {
            set;
            get;
        }

        [DisplayName("Experience To")]
        //[Integer(ErrorMessage = "Integer value is required!")]
        public object ExperienceTo
        {
            set;
            get;
        }

        [DisplayName("Salary From")]
        //[Integer(ErrorMessage = "Integer value is required!")]
        public object SalaryFrom
        {
            set;
            get;
        }

        [DisplayName("Salary To")]
        //[Integer(ErrorMessage = "Integer value is required!")]
        public object SalaryTo
        {
            set;
            get;
        }

        [Required]
        [DisplayName("User")]
        public object UserId
        {
            set;
            get;
        }

        #endregion
    }
}
